package com.ezregex;

import java.util.Collections;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ggargiulo
 * Date: 3/8/13
 * Time: 10:20 AM
 * To change this template use File | Settings | File Templates.
 */
public class RegexItemBuilder {

    public static String literal(String literal) {
        return literal;
    }


    public static String oneOf(List<CharacterClasses> regexCharacterClasses, String... character) {
        String characterSequence = "[";

        for (CharacterClasses characterClasses : regexCharacterClasses) {
            characterSequence += characterClasses.getRegexClassType();
        }

        for (String userClassType : character) {
            characterSequence += userClassType;
        }

        characterSequence += "]";

        return characterSequence;
    }

    public static String oneOf(String... character) {
        return oneOf(emptyList(), character);
    }

    private static List<CharacterClasses> emptyList() {
        return Collections.emptyList();
    }

}
